package com.ruoyi.map.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.map.domain.MapStation;
import com.ruoyi.map.domain.StationDevice;
import com.ruoyi.map.service.StationDeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: my-ruoyi-master_202130504106_李航
 * @description:
 * @author: LiHang
 * @create: 2021-10-30 18:07
 **/
@Api("二级站与设备信息获取类")
@Slf4j
@RestController
public class StationDeviceContorller {

    @Autowired
    StationDeviceService stationDeviceService;

    /**
     * 根据地区查询二级站相关信息
     * @param stationDevice
     * @return
     */
    @ApiOperation(value = "根据二级站id查询其所拥有的设备id和设备名(返回的为二级站和设备id等存储信息，可后期改为只返回id)", notes = "示例:http://192.168.1.217:8180/selectDeviceByStationId\n请求头附带省份区域信息")
    //@ResponseBody
    @PostMapping("/selectDeviceByStationId")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationId",value="二级站id",paramType = "query",dataType = "int"),

    })
    public AjaxResult selectPlotbyProvince(StationDevice stationDevice){
        List<StationDevice> stationDevices = stationDeviceService.selectByStationId(stationDevice);
        return AjaxResult.success(stationDevices);
    }
}
